/*Replication of results in "Subnational Patterns of Participation: Compulsory 
		Voting and the Conditional Impact of Institutional Design"
  Authors: Tiffany Barnes (tiffanydbarnes@uky.edu) and Gabriela Rangel (rangel-katzg@vmi.edu)*/


/*This do-file replicates the results presented in Table 1 in the main manuscript.
 Analyses were performed in Stata 14.1. The dataset includes data collected from 
 the Chile Electoral Service (www.servel.cl) and various other sources. Dataset enclosed.*/

/*Variable Names and Description:
	Dependent Variables:
		- turnout=Turnout
		- blankvote=Blank Vote
		- nullvote= Null Vote
	Independent Variables:
		- voluntary= Voluntary Voting (1=voluntary; 0=compulsory)
		- districtsize= District Size (Logged)
		- c_districtsize= District Size * Voluntary Voting
		- competition= Electoral Competition
		- c_competition= Electoral Competition * Voluntary Voting
		- fragmentation= Candidate Fragmentation
		- c_fragmentation= Candidate Fragmentation * Voluntary Voting
		- fragmentationsqr= Candidate Fragmentation Squared
		- c_fragmentationsqr= Candidate Fragmentation Squared * Voluntary Voting
		- campaignspending= Campaign Spending (in thousands) Per Capita 
		- percenturban= Percent Urban Population
		- openseat= Open Seat
		- magnitude= District Magnitude
		- a_inc= Alianza Incumbent
		- c_inc= Concertacion Incumbent
		- prevturnout= Previous Turnout
		- registration= Registration Rates
		
*/******************************************************************************************
	
*Replication of Table 1 in the Main Manuscript*

//Model 1 (Turnout 2008-2012)
#delimit ;
glm turnout voluntary districtsize c_districtsize competition c_competition fragmentation c_fragmentation 
	fragmentationsqr c_fragmentationsqr campaignspending percenturban openseat magnitude a_inc c_inc prevturnout 
	if outlier==0 & year>=2008, family(binomial 1) link(logit) vce(cluster comuna_id) ;

//Model 2 (Blank Vote 2008-2012)
#delimit ;
glm blankvote voluntary districtsize c_districtsize competition c_competition fragmentation c_fragmentation 
	fragmentationsqr c_fragmentationsqr campaignspending percenturban openseat magnitude a_inc c_inc   
	if year>=2008, family(binomial 1) link(logit) vce(cluster comuna_id) ;

//Model 3 (Null Vote 2008-2012)	
#delimit ;
glm nullvote voluntary districtsize c_districtsize competition c_competition fragmentation c_fragmentation 
	fragmentationsqr c_fragmentationsqr campaignspending percenturban openseat magnitude a_inc c_inc   
	if year>=2008, family(binomial 1) link(logit) vce(cluster comuna_id) ;

//Model 4 (Turnout 2004-2012)
#delimit ;
glm turnout voluntary districtsize c_districtsize competition c_competition fragmentation c_fragmentation 
	fragmentationsqr c_fragmentationsqr campaignspending percenturban openseat magnitude a_inc c_inc prevturnout 
	if outlier==0 & year>=2004, family(binomial 1) link(logit) vce(cluster comuna_id) ;

//Model 5 (Blank Vote 2004-2012)
#delimit ;
glm blankvote voluntary districtsize c_districtsize competition c_competition fragmentation c_fragmentation 
	fragmentationsqr c_fragmentationsqr campaignspending percenturban openseat magnitude a_inc c_inc   
	if year>=2004, family(binomial 1) link(logit) vce(cluster comuna_id) ;

//Model 6 (Null Vote 2004-2012)	
#delimit ;
glm nullvote voluntary districtsize c_districtsize competition c_competition fragmentation c_fragmentation 
	fragmentationsqr c_fragmentationsqr campaignspending percenturban openseat magnitude a_inc c_inc   
	if year>=2004, family(binomial 1) link(logit) vce(cluster comuna_id) ;





